<?php
/**
 * Created by PhpStrom
 * User: 郭碧云
 * Date: 2021/7/15 14:25
 * Desc:
 */

namespace App\Service;


use App\Models\QuestionContent;

class QuestionContentService extends BaseService
{
    protected $modelName="QuestionContent";
    //保存数据
    public function saveAdd($id,$data){
        $data = ["question_id"=>$id,"content"=>$data["content"],"answer"=>$data["answer"]];
        return $this->create($data);
    }
    //更新数据
    public function saveUpdate($id,$data){
        return (new QuestionContent())->where("question_id", $id)->update($data);
    }
}
